package com.gitee.xhs.customFunction;

import com.gitee.xhs.sampleRecod.transactionRecord.Transaction;
import org.apache.flink.streaming.api.functions.ProcessFunction;
import org.apache.flink.util.Collector;

import static com.gitee.xhs.OperatorConstant.ITERATOR_OUT_PUT_TAG;

/**
 * @author BigHead
 * @date 2022/7/19 16:44
 * @description OperatorCopyTransactionProcess
 */
public class OperatorCopyTransactionProcess extends ProcessFunction<Transaction, Transaction> {
    @Override
    public void processElement(Transaction value, ProcessFunction<Transaction, Transaction>.Context ctx, Collector<Transaction> out) throws Exception {
        out.collect(value);
        ctx.output(
                ITERATOR_OUT_PUT_TAG,
                value
        );
    }
}
